﻿
@{
    Layout = null;
}



<!DOCTYPE html>
<html data-use-rem="750">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="format-detection" content="telephone=no, email=no">
    <title>经销商查询</title>


    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="http://tym.amiyx.com/mui/css/mui.min.css">
    <link href="http://tym.amiyx.com/assets/css/tianyan.css" rel="stylesheet" type="text/css" />
    <link href="http://tym.amiyx.com/assets/css/mui.page.css" rel="stylesheet" type="text/css" />

</head>

<body>
    <input name="hid_ids" type="hidden" id="hid_ids" />
    <input name="hid_page" type="hidden" id="hid_page" value="1" />
    <div class="mui-inner-wrap">
        <header class="mui-bar mui-bar-nav">
            <h1 class="mui-title">经销商网点</h1>
        </header>

        <div class="mui-content">

            <section class="mo2 mui-clearfix">
                <span class="mui-icon mui-icon-arrowdown downSele" class1=""></span>
                <div class="mui-pull-left">
                    <span>所属省市</span>
                    <select name="txtProvice"  id="txtProvice">
                        <option selected="selected" value="">--选择--</option>
                        <option value="501">北京市</option>
                        <option value="502">天津市</option>
                        <option value="503">河北省</option>
                        <option value="504">山西省</option>
                        <option value="505">内蒙古自治区</option>
                        <option value="506">辽宁省</option>
                        <option value="507">吉林省</option>
                        <option value="508">黑龙江省</option>
                        <option value="509">上海市</option>
                        <option value="510">江苏省</option>
                        <option value="511">浙江省</option>
                        <option value="512">安徽省</option>
                        <option value="513">福建省</option>
                        <option value="514">江西省</option>
                        <option value="515">山东省</option>
                        <option value="516">河南省</option>
                        <option value="517">湖北省</option>
                        <option value="518">湖南省</option>
                        <option value="519">广东省</option>
                        <option value="520">广西壮族自治区</option>
                        <option value="521">海南省</option>
                        <option value="522">重庆市</option>
                        <option value="523">四川省</option>
                        <option value="524">贵州省</option>
                        <option value="525">云南省</option>
                        <option value="526">西藏自治区</option>
                        <option value="527">陕西省</option>
                        <option value="528">甘肃省</option>
                        <option value="529">青海省</option>
                        <option value="530">宁夏回族自治区</option>
                        <option value="531">新疆维吾尔自治区</option>
                        <option value="532">台湾省</option>
                        <option value="533">香港特别行政区</option>
                        <option value="534">澳门特别行政区</option>
                        <option value="535">海外</option>
                        <option value="536">其他</option>
                    </select>
                </div>
                <div class="mui-pull-right">
                    <input id="txt_search" type="text" />
                    <button id="btn_search" type="button">查询</button>
                </div>
            </section>

            <div class="mui-slider-group" id="content_box">


                <!--<ul class="mui-table-view lj2">
                    <li class="mui-table-view-cell" style="padding:0;">

                        <div class="mui-slider-handle">
                            <div class="mui-card">
                                <div class="mui-card-content">
                                    <div class="mui-card-content-inner" style="margin-bottom:10px;">
                                        <h4>吉林泰和丰汽车配件有限公司  </h4>
                                        <h5>电话：18143103737</h5>

                                        <h5>地址：中国吉林省长春市绿园区高力汽贸城B区24-120号</h5>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </li>
                </ul>-->
                 



            </div>

        </div>
    </div>


    <script type="text/javascript" src="http://tym.amiyx.com/mui/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="http://tym.amiyx.com/mui/js/mui.min.js"></script>
    <script type="text/javascript" src="http://tym.amiyx.com/mui/js/mui.pullToRefresh.js"></script>
    <script type="text/javascript" src="http://tym.amiyx.com/mui/js/mui.pullToRefresh.material.js"></script>
    <script type="text/javascript" src="http://tym.amiyx.com/mui/js/jquery.min.js"></script>
    <script type="text/javascript">

        var key = "";
        var page_count = 4;

        mui.init();
        (function ($) {
            //阻尼系数
            var deceleration = mui.os.ios ? 0.003 : 0.0009;

            $.ready(function () {
                jQuery("#txt_search").val(key);


                //循环初始化所有下拉刷新，上拉加载。
                $.each(document.querySelectorAll('#content_box'), function (index, pullRefreshEl) {
                    $(pullRefreshEl).pullToRefresh({
                        down: {
                            contentrefresh: "正在刷新...",
                            callback: function () {
                                var self = this;
                                setTimeout(function () {
                                    createFragment();
                                    self.endPullDownToRefresh();
                                }, 1000);
                            }
                        },
                        up: {
                            contentrefresh: "正在刷新...",
                            callback: function () {
                                var self = this;
                                setTimeout(function () {
                                    createFragment();
                                    self.endPullUpToRefresh();
                                }, 1000);
                            }
                        }
                    });
                });
                var createFragment = function () {

                    var pid = jQuery("#txtProvice").val(); //document.getElementById("hid_ids").value;
                    var cur_page = document.getElementById("hid_page").value;
                    var s1 = document.getElementById("txt_search").value;
                    cur_page++;

                    if (cur_page <= page_count) {

                    }
                    else {
                        mui.toast("没有更多数据");
                        jQuery(".mui-pull-bottom-tips").hide();
                        return;
                    }

         
                    mui.ajax('/API/ShopList', {
                        data: {
                            ProvinceID: pid,
                            BrandID:29,
                            page: cur_page,
                            size: 5000,
                            Key: s1
                        },
                        dataType: 'json',
                        type: 'GET',
                        timeout: 5000,
                        success: function (data) {
                            document.getElementById("hid_page").value = cur_page;
                            if (data != "") {
                                $(data.dt).each(function (i, item) {
                                    var s = "";
                                    s += "<ul class=\"mui-table-view lj2\">";
                                    s += "<li class=\"mui-table-view-cell\" style=\"padding:0;\">";
                                    s += "<div class=\"mui-slider-handle\">";
                                    s += "<div class=\"mui-card\">";
                                    s += "<div class=\"mui-card-content\">";
                                    s += "<div class=\"mui-card-content-inner\" style=\"margin-bottom:10px;\">";
                                    s += " <h4>" + item.ShopName + "</h4>";
                                    s += "<h5>电话：" + item.ShopTel + "</h5>";
                                    s += "<h5>地址："  + item.ShopAddress + "</h5>";
                                    s += "</div>";
                                    s += "</div>";
                                    s += "</div>";
                                    s += "</div>";
                                    s += "</li>";
                                    s += "</ul>";

                                    jQuery(s).insertBefore(".mui-pull-bottom-tips");

                                });
                            }
                            else {
                                mui.toast("没有更多数据");
                                console.log(data);
                            }
                        },
                        error: function (xhr, type, errorThrown) {
                            mui.alert(type);
                        }
                    });

                };
            });
        })(mui);

        mui.ready(function () {
            if (page_count > 1) {
                jQuery(".mui-pull-bottom-tips").show();
            }
            else {
                jQuery(".mui-pull-bottom-tips").hide();
                mui('#content_box').pullRefresh().setStopped(true);
            }
        });

        jQuery(function () {
            jQuery("#btn_search").click(function ()
            {
                jQuery("#content_box").empty();

                var pid = jQuery("#txtProvice").val(); //document.getElementById("hid_ids").value;
                var cur_page = document.getElementById("hid_page").value;
                var s1 = document.getElementById("txt_search").value;

                mui.ajax('/API/ShopList', {
                    data: {
                        ProvinceID: pid,
                        BrandID: 29,
                        page: 1,
                        size: 5000,
                        Key: s1
                    },
                    dataType: 'json',
                    type: 'GET',
                    timeout: 5000,
                    success: function (data) {
                        document.getElementById("hid_page").value = cur_page;
                        if (data != "") {
                            $(data.dt).each(function (i, item) {
                                var s = "";
                                s += "<ul class=\"mui-table-view lj2\">";
                                s += "<li class=\"mui-table-view-cell\" style=\"padding:0;\">";
                                s += "<div class=\"mui-slider-handle\">";
                                s += "<div class=\"mui-card\">";
                                s += "<div class=\"mui-card-content\">";
                                s += "<div class=\"mui-card-content-inner\" style=\"margin-bottom:10px;\">";
                                s += " <h4>" + item.ShopName + "</h4>";
                                s += "<h5>电话：" + item.ShopTel + "</h5>";
                                s += "<h5>地址：" + item.ShopAddress + "</h5>";
                                s += "</div>";
                                s += "</div>";
                                s += "</div>";
                                s += "</div>";
                                s += "</li>";
                                s += "</ul>";

                                jQuery(s).insertBefore(".mui-pull-bottom-tips");

                            });
                        }
                        else {
                            mui.toast("没有更多数据");
                            console.log(data);
                        }
                    },
                    error: function (xhr, type, errorThrown) {
                        mui.alert(type);
                    }
                });

            });

            //            jQuery('.mui-slider-handle').click(function(){
            //                location.href =jQuery(this).attr("url");
            //            });

            jQuery("#txtProvice").change(function () {
                jQuery(".yincf").slideToggle();
                jQuery("#txt_search").focus();

                jQuery("#content_box").empty();

                var pid = jQuery("#txtProvice").val(); //document.getElementById("hid_ids").value;
                var cur_page = document.getElementById("hid_page").value;
                var s1 = document.getElementById("txt_search").value;


                mui.ajax('/API/ShopList', {
                    data: {
                        ProvinceID: pid,
                        BrandID: 29,
                        page: 1,
                        size: 5000,
                        Key: s1
                    },
                    dataType: 'json',
                    type: 'GET',
                    timeout: 5000,
                    success: function (data) {
                        document.getElementById("hid_page").value = cur_page;
                        if (data != "") {
                            $(data.dt).each(function (i, item) {
                                var s = "";
                                s += "<ul class=\"mui-table-view lj2\">";
                                s += "<li class=\"mui-table-view-cell\" style=\"padding:0;\">";
                                s += "<div class=\"mui-slider-handle\">";
                                s += "<div class=\"mui-card\">";
                                s += "<div class=\"mui-card-content\">";
                                s += "<div class=\"mui-card-content-inner\" style=\"margin-bottom:10px;\">";
                                s += " <h4>" + item.ShopName + "</h4>";
                                s += "<h5>电话：" + item.ShopTel + "</h5>";
                                s += "<h5>地址：" + item.ShopAddress + "</h5>";
                                s += "</div>";
                                s += "</div>";
                                s += "</div>";
                                s += "</div>";
                                s += "</li>";
                                s += "</ul>";

                                jQuery(s).insertBefore(".mui-pull-bottom-tips");

                            });
                        }
                        else {
                            mui.toast("没有更多数据");
                            console.log(data);
                        }
                    },
                    error: function (xhr, type, errorThrown) {
                        mui.alert(type);
                    }
                });


            });
        })

    </script>

</body>

</html>
